class Range {
	
	public var min:Float;
	public var max:Float;
	public var step:Float;
	public var offset:Bool;
	
	public function new(min:Float, max:Float, step:Float, offset:Bool) {
		this.min = min;
		this.max = max;
		this.step = step;
		this.offset = offset;
	}
	
	public function count():Float {
		//
		// range, 5 - 10 = 10 - 5 = 5
		// range -5 - 5 = 5 - -5 = 10
		//
		//
		//  x_offset:
		//
		//   False            True
		//
		//  |               |
		//  |               |
		//  |               |
		//  +--+--+--+      |-+--+--+--+-+
		//  0  1  2  3        0  1  2  3
		//
		// Don't forget this is also used in radar axis
		//
		if( this.offset )
			return (this.max - this.min) + 1;
		else
			return this.max - this.min;			
	}
	
	public function toString():String {
		return 'Range : ' + this.min +', ' + this.max;
	}
}
